package cn.mesmile.video.service.impl;

import cn.mesmile.daomain.Video;
import cn.mesmile.video.dao.VideoMapper;
import cn.mesmile.video.service.VideoService;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

/**
 * @author zb
 * @version 1.0
 * @date 2020/10/24 13:02
 * @description
 */
@Service
public class VideoServiceImpl implements VideoService {

    private final VideoMapper videoMapper;

    public VideoServiceImpl(VideoMapper videoMapper) {
        this.videoMapper = videoMapper;
    }

    @Override
    public Video getVideoById(Integer videoId) {
        Assert.notNull(videoId, "视频id 不允许为空");
        return videoMapper.getVideoById(videoId);
    }
}
